Real-Time adaptive receive side scaling key selection

ABSTRACT

Selecting a receive side scaling (RSS) key is provided. It is determined whether a defined time interval expired. In response to determining that the defined time interval has expired, it is determined whether one or more keys in a set of randomly generated candidate RSS keys have a higher packet distribution score than an active RSS key. In response to determining that one or more keys in the set of randomly generated candidate RSS keys have a higher packet distribution score than the active RSS key, an RSS key having a highest packet distribution score is selected from the one or more keys in the set of randomly generated candidate RSS keys that have a higher packet distribution score than the active RSS key. The RSS key having the highest packet distribution score is used to distribute incoming network packets across a plurality of processors.

CROSS REFERENCE TO RELATED APPLICATIONS

The present application is a continuation application of U.S. patentapplication Ser. No. 15/729,805, filed on Oct. 11, 2017, entitledREAL-TIME ADAPTIVE RECEIVE SIDE SCALING KEY SELECTION.

BACKGROUND

1. Field:

The disclosure relates generally to receive side scaling and morespecifically to selecting a receive side scaling key having a highestpacket distribution score that uniformly distributes incoming networkpackets across multiple central processing units in a multiprocessordevice or across multiple processor cores in a multicore centralprocessing unit.

2. Description of the Related Art:

Receive side scaling (RSS) is a network adapter technology enablingdistribution of network receive processing across multiple centralprocessing units in a multiprocessor data processing device, such as acomputer. In other words, RSS enables packet receive processing to scalewith the number of processors in the multiprocessor data processingdevice. As a result, RSS helps to make it possible to support highernetwork traffic loads.

RSS uses a hash function with an RSS hash key to determine thedistribution of each incoming network packet. The hash function andresulting hash value provides the means for selecting a processor in themultiprocessor data processing device. The hash function computes a hashvalue over a defined area within a received network packet. The definedarea may be contiguous or noncontiguous. RSS uses a number of leastsignificant bits of the hash value to index an indirection table. RSSuses the values in the indirection table to assign the received networkpacket to a processor. In other words, the RSS indirection tableidentifies a particular processor in the multiprocessor device toprocess the received network packet. In addition, RSS includes asignature that provides added security. This signature protects themultiprocessor device from malicious remote hosts attempting to forcethe multiprocessor device into an unbalanced state.

SUMMARY

According to one illustrative embodiment, a computer-implemented methodfor selecting a receive side scaling (RSS) key is provided. A dataprocessing system determines whether a defined time interval expired. Inresponse to the data processing system determining that the defined timeinterval has expired, the data processing system determines whether oneor more keys in a set of randomly generated candidate RSS keys have ahigher packet distribution score than an active RSS key. In response tothe data processing system determining that one or more keys in the setof randomly generated candidate RSS keys have a higher packetdistribution score than the active RSS key, the data processing systemselects an RSS key having a highest packet distribution score from theone or more keys in the set of randomly generated candidate RSS keysthat have a higher packet distribution score than the active RSS key.The data processing system uses the RSS key having the highest packetdistribution score to distribute incoming network packets across aplurality of processors corresponding to the data processing system.

BRIEF DESCRIPTION OF THE DRAWINGS

FIG. 1 is a pictorial representation of a network of data processingsystems in which illustrative embodiments may be implemented;

FIG. 2 is a diagram of a data processing system in which illustrativeembodiments may be implemented;

FIG. 3 is a diagram of a network packet distribution system in whichillustrative embodiments may be implemented;

FIG. 4 is a flowchart illustrating a process for evaluating receive sidescaling (RSS) key performance in accordance with an illustrativeembodiment; and

FIG. 5 is a flowchart illustrating a process for selecting RSS keys inaccordance with an illustrative embodiment.

DETAILED DESCRIPTION

The present invention may be a system, a method, and/or a computerprogram product at any possible technical detail level of integration.The computer program product may include a computer readable storagemedium (or media) having computer readable program instructions thereonfor causing a processor to carry out aspects of the present invention.

The computer readable storage medium can be a tangible device that canretain and store instructions for use by an instruction executiondevice. The computer readable storage medium may be, for example, but isnot limited to, an electronic storage device, a magnetic storage device,an optical storage device, an electromagnetic storage device, asemiconductor storage device, or any suitable combination of theforegoing. A non-exhaustive list of more specific examples of thecomputer readable storage medium includes the following: a portablecomputer diskette, a hard disk, a random access memory (RAM), aread-only memory (ROM), an erasable programmable read-only memory (EPROMor Flash memory), a static random access memory (SRAM), a portablecompact disc read-only memory (CD-ROM), a digital versatile disk (DVD),a memory stick, a floppy disk, a mechanically encoded device such aspunch-cards or raised structures in a groove having instructionsrecorded thereon, and any suitable combination of the foregoing. Acomputer readable storage medium, as used herein, is not to be construedas being transitory signals per se, such as radio waves or other freelypropagating electromagnetic waves, electromagnetic waves propagatingthrough a waveguide or other transmission media (e.g., light pulsespassing through a fiber-optic cable), or electrical signals transmittedthrough a wire.

Computer readable program instructions described herein can bedownloaded to respective computing/processing devices from a computerreadable storage medium or to an external computer or external storagedevice via a network, for example, the Internet, a local area network, awide area network and/or a wireless network. The network may comprisecopper transmission cables, optical transmission fibers, wirelesstransmission, routers, firewalls, switches, gateway computers and/oredge servers. A network adapter card or network interface in eachcomputing/processing device receives computer readable programinstructions from the network and forwards the computer readable programinstructions for storage in a computer readable storage medium withinthe respective computing/processing device.

Computer readable program instructions for carrying out operations ofthe present invention may be assembler instructions,instruction-set-architecture (ISA) instructions, machine instructions,machine dependent instructions, microcode, firmware instructions,state-setting data, configuration data for integrated circuitry, oreither source code or object code written in any combination of one ormore programming languages, including an object oriented programminglanguage such as Smalltalk, C++, or the like, and procedural programminglanguages, such as the “C” programming language or similar programminglanguages. The computer readable program instructions may executeentirely on the user's computer, partly on the user's computer, as astand-alone software package, partly on the user's computer and partlyon a remote computer or entirely on the remote computer or server. Inthe latter scenario, the remote computer may be connected to the user'scomputer through any type of network, including a local area network(LAN) or a wide area network (WAN), or the connection may be made to anexternal computer (for example, through the Internet using an InternetService Provider). In some embodiments, electronic circuitry including,for example, programmable logic circuitry, field-programmable gatearrays (FPGA), or programmable logic arrays (PLA) may execute thecomputer readable program instructions by utilizing state information ofthe computer readable program instructions to personalize the electroniccircuitry, in order to perform aspects of the present invention.

Aspects of the present invention are described herein with reference toflowchart illustrations and/or block diagrams of methods, apparatus(systems), and computer program products according to embodiments of theinvention. It will be understood that each block of the flowchartillustrations and/or block diagrams, and combinations of blocks in theflowchart illustrations and/or block diagrams, can be implemented bycomputer readable program instructions.

These computer readable program instructions may be provided to aprocessor of a general purpose computer, special purpose computer, orother programmable data processing apparatus to produce a machine, suchthat the instructions, which execute via the processor of the computeror other programmable data processing apparatus, create means forimplementing the functions/acts specified in the flowchart and/or blockdiagram block or blocks. These computer readable program instructionsmay also be stored in a computer readable storage medium that can directa computer, a programmable data processing apparatus, and/or otherdevices to function in a particular manner, such that the computerreadable storage medium having instructions stored therein comprises anarticle of manufacture including instructions which implement aspects ofthe function/act specified in the flowchart and/or block diagram blockor blocks.

The computer readable program instructions may also be loaded onto acomputer, other programmable data processing apparatus, or other deviceto cause a series of operational steps to be performed on the computer,other programmable apparatus or other device to produce a computerimplemented process, such that the instructions which execute on thecomputer, other programmable apparatus, or other device implement thefunctions/acts specified in the flowchart and/or block diagram block orblocks.

The flowchart and block diagrams in the Figures illustrate thearchitecture, functionality, and operation of possible implementationsof systems, methods, and computer program products according to variousembodiments of the present invention. In this regard, each block in theflowchart or block diagrams may represent a module, segment, or portionof instructions, which comprises one or more executable instructions forimplementing the specified logical function(s). In some alternativeimplementations, the functions noted in the blocks may occur out of theorder noted in the Figures. For example, two blocks shown in successionmay, in fact, be executed substantially concurrently, or the blocks maysometimes be executed in the reverse order, depending upon thefunctionality involved. It will also be noted that each block of theblock diagrams and/or flowchart illustration, and combinations of blocksin the block diagrams and/or flowchart illustration, can be implementedby special purpose hardware-based systems that perform the specifiedfunctions or acts or carry out combinations of special purpose hardwareand computer instructions.

With reference now to the figures, and in particular, with reference toFIGS. 1-3, diagrams of data processing environments are provided inwhich illustrative embodiments may be implemented. It should beappreciated that FIGS. 1-3 are only meant as examples and are notintended to assert or imply any limitation with regard to theenvironments in which different embodiments may be implemented. Manymodifications to the depicted environments may be made.

FIG. 1 depicts a pictorial representation of a network of dataprocessing systems in which illustrative embodiments may be implemented.Network data processing system 100 is a network of computers, dataprocessing systems, and other devices in which the illustrativeembodiments may be implemented. Network data processing system 100contains network 102, which is the medium used to provide communicationslinks between the computers, data processing systems, and other devicesconnected together within network data processing system 100. Network102 may include connections, such as, for example, wire communicationlinks, wireless communication links, and fiber optic cables.

In the depicted example, server 104 and server 106 connect to network102, along with storage 108. Server 104 and server 106 may be, forexample, server computers with high-speed connections to network 102. Inaddition, server 104 and server 106 may provide one or more services toclient devices. For example, server 104 and server 106 may provideintrusion prevention services or firewall services to registered clientdevices. Also, it should be noted that server 104 and server 106 mayeach represent a plurality of different servers providing a plurality ofdifferent network security services.

Client 110, client 112, and client 114 also connect to network 102.Clients 110, 112, and 114 are clients of server 104 and/or server 106.Users of clients 110, 112, and 114 may utilize clients 110, 112, and 114to request services or information from server 104, server 106, or otherdata processing devices connected to network 102.

In this example, clients 110, 112, and 114 are illustrated as desktop orpersonal computers with wire communication links to network 102.However, it should be noted that clients 110, 112, and 114 are meant asexamples only. In other words, clients 110, 112, and 114 may includeother types of data processing systems, such as, for example, networkcomputers, laptop computers, handheld computers, smart phones, smartwatches, personal digital assistants, gaming devices, and the like, withwire or wireless communication links to network 102.

Storage 108 is a network storage device capable of storing any type ofdata in a structured format or an unstructured format. In addition,storage 108 may represent a set of one or more network storage devices.Storage 108 may store, for example, identifiers for a plurality ofdifferent network devices; identifiers for a plurality of processorslocated in each of the plurality of different network devices; hashfunctions; processor network packet distribution scores; and the like.Further, storage 108 may store other data, such as authentication orcredential data that may include user names, passwords, and biometricdata associated with users and system administrators, for example.

In addition, it should be noted that network data processing system 100may include any number of additional server devices, client devices, andother devices not shown. Program code located in network data processingsystem 100 may be stored on a computer readable storage medium anddownloaded to a computer or data processing system for use. For example,program code may be stored on a computer readable storage medium onserver 104 and downloaded to client 110 over network 102 for use onclient 110.

In the depicted example, network data processing system 100 may beimplemented as a number of different types of communication networks,such as, for example, an internet, an intranet, a local area network(LAN), a wide area network (WAN), or any combination thereof. FIG. 1 isintended as an example only, and not as an architectural limitation forthe different illustrative embodiments.

With reference now to FIG. 2, a diagram of a data processing system isdepicted in accordance with an illustrative embodiment. Data processingsystem 200 is an example of a data processing device, such as server 104or client 110 in FIG. 1, in which computer readable program code orprogram instructions implementing processes of illustrative embodimentsmay be located. In this illustrative example, data processing system 200includes communications fabric 202, which provides communicationsbetween processor unit 204, memory 206, persistent storage 208,communications unit 210, input/output (I/O) unit 212, and display 214.

Processor unit 204 serves to execute instructions for softwareapplications and programs that may be loaded into memory 206. Inaddition, processor unit 204 processes incoming network packets to dataprocessing system 200. In this example, processor unit 204 may representa set of two or more hardware processor devices or may represent oneprocessor device with two or more processor cores, depending on theparticular implementation. Further, different illustrative embodimentsmay implement processor unit 204 using multiple heterogeneous processorsor using multiple processors of the same type.

Memory 206 and persistent storage 208 are examples of storage devices216. A computer readable storage device is any piece of hardware that iscapable of storing information, such as, for example, withoutlimitation, data, computer readable program code in functional form,and/or other suitable information either on a transient basis and/or apersistent basis. Further, a computer readable storage device excludes apropagation medium. Memory 206, in these examples, may be, for example,a random-access memory, or any other suitable volatile or non-volatilestorage device. Persistent storage 208 may take various forms, dependingon the particular implementation. For example, persistent storage 208may contain one or more devices. For example, persistent storage 208 maybe a hard drive, a flash memory, a rewritable optical disk, a rewritablemagnetic tape, or some combination of the above. The media used bypersistent storage 208 may be removable. For example, a removable harddrive may be used for persistent storage 208.

In this example, persistent storage 208 stores packet distributionmanager 218. However, it should be noted that even though packetdistribution manager 218 is illustrated as residing in persistentstorage 208, in an alternative illustrative embodiment packetdistribution manager 218 may be a separate component of data processingsystem 200. For example, packet distribution manager 218 may be ahardware component coupled to communication fabric 202 or a combinationof hardware and software components.

Packet distribution manager 218 controls the processes of randomlygenerating RSS keys, evaluating the performance of the RSS keys indistributing incoming network packets across multiple processors ormultiple processor cores, generating packet distribution scores for eachof the RSS keys, selecting an RSS key having a highest packetdistribution score to uniformly distribute the incoming network packetsbetween the multiple processors or multiple processor cores, discardingRSS keys having a packet distribution score below a defined thresholdscore, and randomly generating replacement RSS keys. In this example,packet distribution manager 218 includes random key generator 220,performance evaluation function 222, and replacement module 224.However, it should be noted that packet distribution manager 218 mayinclude more or fewer components than shown. For example, one componentmay be split into two or more components, two or more components may becombined into one component, or components not shown may be added.

Packet distribution manager 218 utilizes random key generator 220 torandomly generate a number of keys for candidate key pool 226. Candidatekey pool 226 includes RSS keys 228. It should be noted that candidatekey pool 226 may have a predefined size. In other words, candidate keypool 226 may only contain a predefined number of RSS keys. RSS keys 228represent a plurality of randomly generated RSS keys. RSS keys 228include active RSS key 230 and candidate RSS keys 232.

Active RSS key 230 represents an RSS key that packet distributionmanager 218 is currently utilizing to distribute incoming networkpackets across the multiple processors or multiple processor coreslocated in data processing system 200. Candidate RSS keys 232 representa set of two or more RSS keys that packet distribution manager 218 mayutilize to replace active RSS key 230 when one or more of candidate RSSkeys 232 have a higher packet distribution score than active RSS key230.

Packet distribution manager 218 utilizes performance evaluation function222 to evaluate how well active RSS key 230 and each of candidate RSSkeys 232 are balancing the number of incoming network packets betweenthe multiple processors or multiple processor cores located in dataprocessing system 200. Based on determining how well active RSS key 230and each of candidate RSS keys 232 are distributing incoming networkpackets uniformly across the multiple processors or multiple processorcores, performance evaluation function 222 generates a packetdistribution score for active RSS key 230 and each of candidate RSS keys232, such as packet distribution scores 234. In addition, at definedtime interval 236, performance evaluation function 222 re-evaluates eachof RSS keys 228, which include active RSS key 230 and candidate RSS keys232. Defined time interval 236 represents a predefined interval of time,such as thirty minutes, one hour, two hours, six hours, twelve hours,one day, or any other interval of time, when performance evaluationfunction 222 evaluates all keys in RSS keys 228.

Packet distribution manager 218 utilizes replacement module 224 todetermine when to discard RSS keys 240 and generate new replacement keys242. RSS keys 240 represent one or more RSS keys that have a packetdistribution score below defined packet distribution threshold score238. Defined packet distribution threshold score 238 represents apredefined minimum threshold score for uniformly distributing incomingnetwork packet across the multiple processors or multiple processorcores. New replacement keys 242 represent a number of new randomlygenerated RSS keys, which are to replace the one or more discarded RSSkeys 240.

Communications unit 210, in this example, provides for communicationwith other computers, data processing systems, and devices via anetwork, such as network 102 in FIG. 1. Communications unit 210 mayprovide communications using both physical and wireless communicationslinks. The physical communications link may utilize, for example, awire, cable, universal serial bus, or any other physical technology toestablish a physical communications link for data processing system 200.The wireless communications link may utilize, for example, shortwave,high frequency, ultra-high frequency, microwave, wireless fidelity(WiFi), Bluetooth® technology, global system for mobile communications(GSM), code division multiple access (CDMA), second-generation (2G),third-generation (3G), fourth-generation (4G), 4G Long Term Evolution(LTE), LTE Advanced, or any other wireless communication technology orstandard to establish a wireless communications link for data processingsystem 200.

Input/output unit 212 allows for the input and output of data with otherdevices that may be connected to data processing system 200. Forexample, input/output unit 212 may provide a connection for user inputthrough a keyboard, keypad, mouse, and/or some other suitable inputdevice. Display 214 provides a mechanism to display information to auser and may include touch screen capabilities to allow the user to makeon-screen selections through user interfaces or input data, for example.

Instructions for the operating system, applications, and/or programs maybe located in storage devices 216, which are in communication withprocessor unit 204 through communications fabric 202. In thisillustrative example, the instructions are in a functional form onpersistent storage 208. These instructions may be loaded into memory 206for running by processor unit 204. The processes of the differentembodiments may be performed by processor unit 204 usingcomputer-implemented program instructions, which may be located in amemory, such as memory 206. These program instructions are referred toas program code, computer usable program code, or computer readableprogram code that may be read and run by a processor in processor unit204. The program code, in the different embodiments, may be embodied ondifferent physical computer readable storage devices, such as memory 206or persistent storage 208.

Program code 244 is located in a functional form on computer readablemedia 246 that is selectively removable and may be loaded onto ortransferred to data processing system 200 for running by processor unit204. Program code 244 and computer readable media 246 form computerprogram product 248. In one example, computer readable media 246 may becomputer readable storage media 250 or computer readable signal media252. Computer readable storage media 250 may include, for example, anoptical or magnetic disc that is inserted or placed into a drive orother device that is part of persistent storage 208 for transfer onto astorage device, such as a hard drive, that is part of persistent storage208. Computer readable storage media 250 also may take the form of apersistent storage, such as a hard drive, a thumb drive, or a flashmemory that is connected to data processing system 200. In someinstances, computer readable storage media 250 may not be removable fromdata processing system 200.

Alternatively, program code 244 may be transferred to data processingsystem 200 using computer readable signal media 252. Computer readablesignal media 252 may be, for example, a propagated data signalcontaining program code 244. For example, computer readable signal media252 may be an electro-magnetic signal, an optical signal, and/or anyother suitable type of signal. These signals may be transmitted overcommunication links, such as wireless communication links, an opticalfiber cable, a coaxial cable, a wire, and/or any other suitable type ofcommunications link. In other words, the communications link and/or theconnection may be physical or wireless in the illustrative examples. Thecomputer readable media also may take the form of non-tangible media,such as communication links or wireless transmissions containing theprogram code.

In some illustrative embodiments, program code 244 may be downloadedover a network to persistent storage 208 from another device or dataprocessing system through computer readable signal media 252 for usewithin data processing system 200. For instance, program code stored ina computer readable storage media in a data processing system may bedownloaded over a network from the data processing system to dataprocessing system 200. The data processing system providing program code244 may be a server computer, a client computer, or some other devicecapable of storing and transmitting program code 244.

The different components illustrated for data processing system 200 arenot meant to provide architectural limitations to the manner in whichdifferent embodiments may be implemented. The different illustrativeembodiments may be implemented in a data processing system includingcomponents in addition to, or in place of, those illustrated for dataprocessing system 200. Other components shown in FIG. 2 can be variedfrom the illustrative examples shown. The different embodiments may beimplemented using any hardware device or system capable of executingprogram code. As one example, data processing system 200 may includeorganic components integrated with inorganic components and/or may becomprised entirely of organic components excluding a human being. Forexample, a storage device may be comprised of an organic semiconductor.

As another example, a computer readable storage device in dataprocessing system 200 is any hardware apparatus that may store data.Memory 206, persistent storage 208, and computer readable storage media250 are examples of physical storage devices in a tangible form.

In another example, a bus system may be used to implement communicationsfabric 202 and may be comprised of one or more buses, such as a systembus or an input/output bus. Of course, the bus system may be implementedusing any suitable type of architecture that provides for a transfer ofdata between different components or devices attached to the bus system.Additionally, a communications unit may include one or more devices usedto transmit and receive data, such as a modem or a network adapter.Further, a memory may be, for example, memory 206 or a cache such asfound in an interface and memory controller hub that may be present incommunications fabric 202.

Existing methods for finding an RSS key to distribute network packets tomultiple processors are pre-defined. For example, these currentlyexisting methods generate a number of RSS keys and run some templatenetwork traffic in a test environment to calculate the results. Then,these currently existing methods select a set of RSS keys with the bestresult from the number of RSS keys. Afterward, these currently existingmethods install the selected set of RSS keys on a multiprocessor device.Then, the multiprocessor device randomly selects one RSS key from theset of RSS keys to distribute the network traffic to multiple processorsin the device.

It would be ideal if network load could be uniformly distributed amongall available processors in the multiprocessor device. However, uniformpacket distribution is difficult, if not impossible, using currentlyexiting methods because real-time network traffic is dynamic andunpredictable and changes all the time. As a result, using a predefinedRSS key set will not provide uniform packet distribution within amultiprocessor device at runtime.

Illustrative embodiments utilize a real-time adaptive RSS key selectionmethod. This method selects the best RSS key for packet distribution inthe multiprocessor device based on actual network packets/connectionsthe multiprocessor device is receiving. Illustrative embodiments mayutilize, for example, control plane or idle processor resources so thatthe impact on overall device performance is minimized. Further, byuniformly distributing packets across the multiple processors,illustrative embodiments increase processor resource utilization,increase the amount of network traffic that can be processed by themultiprocessor device and, thus, increase overall device performance.

Illustrative embodiments utilize components, such as, for example: 1) arandom key generator to randomly generate RSS keys; 2) an active RSS keythat illustrative embodiments currently use to uniformly distributenetwork packets across the multiple processors; 3) a candidate RSS keypool, which illustrative embodiments use to maintain a set of candidateRSS keys of a predefined size; 4) an evaluation function, whichillustrative embodiments use to evaluate RSS key packet distributionperformance (e.g., the evaluation function gives an RSS key a higherpacket distribution score when that particular RSS key uniformlydistributes incoming packets across the multiple processors); and 5) areplacement module, which illustrative embodiments use to removelow-scoring RSS keys (i.e., RSS keys with a packet distribution scorebelow a defined packet distribution threshold score) from the candidateRSS key pool and then replace the discarded RSS keys with new randomlygenerated RSS keys.

In response to receiving a set of incoming network packets by amultiprocessor device, illustrative embodiments calculate a packetdistribution score for the active RSS key and each key in the set ofcandidate RSS keys using the set of incoming network packets.Illustrative embodiments give an RSS key a higher packet distributionscore when the RSS key distributes the set of incoming packets moreuniformly than the other RSS keys. In response to receiving an input toreevaluate the RSS keys at a defined time interval, illustrativeembodiments sort the set of candidate RSS keys according to theirrespective packet distribution scores. Then, illustrative embodimentsdetermine whether one or more keys in the set of candidate RSS keys havea higher packet distribution score than the active RSS key. In responseto determining that one or more keys in the set of candidate RSS keys dohave a higher packet distribution score than the active RSS key,illustrative embodiments replace the active RSS key with the candidateRSS key having the highest packet distribution score.

Thus, illustrative embodiments evaluate each RSS key based on realincoming network packets to determine how well each RSS key isperforming with regard to distributing the set of network packets acrossthe multiple processors in a multiprocessor device. However, it shouldbe noted that illustrative embodiments also may distribute networkpackets across multiple processor cores in a multicore processor. Also,it should be noted that illustrative embodiments may be applied tonetwork devices that are using a data plane development kit, such as,for example, a next generation intrusion prevention system, to improvethe performance of such devices by finding and using the best RSS keyfor uniform distribution of network packets across multiple processorsor cores in a runtime environment. The data plane development kit is aset of data plane libraries and network interface controller drivers forfast packet processing.

With reference now to FIG. 3, a diagram of a network packet distributionsystem is depicted in which illustrative embodiments may be implemented.Network packet distribution system 300 is a system of software andhardware components for automatically distributing incoming networkpackets across multiple processors or across multiple processor coresuniformly by selecting an RSS key having a highest packet distributionscore. Network packet distribution system 300 may be implemented in anetwork of data processing systems, such as network data processingsystem 100 in FIG. 1.

In this example, network packet distribution system 300 includes dataprocessing device 302 and network 304. Data processing device 302 maybe, for example, server 104 or client 110 in FIG. 1 or data processingsystem 200 in FIG. 2. Network 304 may be, for example, network 102 inFIG. 1.

Data processing device 302 receives incoming set of network packets 306via network 304. Set of network packets 306 may represent any type ofnetwork traffic and may contain any type of data. Data processing device302 utilizes packet distribution manager 308, such as packetdistribution manager 218 in FIG. 2, to select active RSS key 310 touniformly distribute set of network packets 312 across processor 314 andprocessor 316. It should be noted that set of network packets 312 is thesame as incoming set of network packets 306. Also, it should be notedthat processor 314 and processor 316 may represent any number ofprocessors, such as tens of processors, hundreds of processors, or eventhousands of processors, for example.

Active RSS key 310 may be, for example, active RSS key 230 in FIG. 2.Packet distribution manager 308 selects active RSS key 310 based on RSSkey 310 having a highest packet distribution score among all RSS keys ina pool of candidate RSS keys, such as RSS keys 228 in FIG. 2. Active RSSkey 310 uniformly distributes set of network packets 312 to processor314 and processor 316 by sending number of packets 318 to processor 314and number of packets 320 to processor 316. Number of packets 318 andnumber of packets 320 represent the actual number of network packetssent to processor 314 and processor 316, respectively, for processing.To be uniform, number of packets 318 and number of packets 320 representan equal number of packets or a number of packets that are substantiallyequal. For example, if set of network packets 312 is twenty networkpackets, then number of packets 318 would be ten network packets andnumber of packets 320 would be ten network packets to be uniformly orevenly distributed to processor 314 and processor 316. Similarly, if setof network packets 312 is twenty-one network packets, then number ofpackets 318 may be ten network packets and number of packets 320 may beeleven network packets to be substantially uniform.

Further, packet distribution manager 308 utilizes performance evaluationfunction 322 to determine how well active RSS key 310 is performing withregarding to distributing set of network packets 312 to processor 314and processor 316. Packet distribution manager 308 may directperformance evaluation function 322 to evaluate the packet distributionperformance of active RSS key 310 at the end of a defined time intervalperiod, such as, for example, defined time interval 236 in FIG. 2. Afterevaluating the packet distribution performance of active RSS key 310,performance evaluation function 322 generates a packet distributionscore for active RSS key 310. In addition, performance evaluationfunction 322 predicts the performance of all RSS keys in the pool ofcandidate RSS keys using set of network packets 312 and generates apacket distribution score for each of the RSS keys in the pool. Ifactive RSS key 310 has the highest packet distribution score, thenpacket distribution manager 308 continues to utilize active RSS key 310to distribute incoming network packets to processor 314 and processor316. However, if an RSS key in the pool has a higher packet distributionscore than active RSS key 310, then packet distribution manager 308replaces active RSS key 310 with the higher scoring RSS key todistribute incoming network packets.

With reference now to FIG. 4, a flowchart illustrating a process forevaluating RSS key performance is shown in accordance with anillustrative embodiment. The process shown in FIG. 4 may be implementedin a data processing system, such as, for example, server 104 or client110 in FIG. 1 or data processing system 200 in FIG. 2.

The process begins when the data processing system generates a candidatekey pool containing a set of randomly generated candidate RSS keys usinga random key generator (step 402). The candidate key pool may be, forexample, candidate key pool 226 in FIG. 2. The set of randomly generatedcandidate RSS keys may be, for example, RSS keys 228 in FIG. 2. Therandom key generator may be, for example, random key generator 220 inFIG. 2.

After generating the candidate key pool in step 402, the data processingsystem selects a key from the set of randomly generated candidate RSSkeys to be an active RSS key for distributing network packets across aplurality of processors located in the data processing system (step404). The active RSS key selected from the set of randomly generatedcandidate RSS keys may be, for example, active RSS key 230 in FIG. 2. Inaddition, the data processing system receives a set of network packetsvia a network (step 406). The set of network packets may be, forexample, set of network packets 312 in FIG. 3. The network may be, forexample, network 304 in FIG. 3.

Further, the data processing system distributes the set of networkpackets across the plurality of processors located in the dataprocessing system using the active RSS key (step 408). The plurality ofprocessors located in the data processing system may be, for example,processor 314 and processor 316 in FIG. 3. Furthermore, the dataprocessing system evaluates performance of the active RSS key inuniformly distributing the set of network packets across the pluralityof processors located in the data processing system (step 410). The dataprocessing system may utilize, for example, a performance evaluationfunction, such as performance evaluation function 322 in FIG. 3, toevaluate the performance of the active RSS key in evenly distributing anumber of network packets between each of the plurality of processors tobalance load between the plurality of processors. The number of networkpackets distributed between the plurality of processors may be, forexample, number of packets 318 and number of packets 320 in FIG. 3.

Moreover, the data processing system generates a packet distributionscore corresponding to the active RSS key based on the evaluation of theperformance of the active RSS key in uniformly distributing the set ofnetwork packets across the plurality of processors located in the dataprocessing system (step 412). In addition, the data processing systempredicts performance of each remaining key in the set of randomlygenerated candidate RSS keys in uniformly distributing the set ofnetwork packets across the plurality of processors located in the dataprocessing system in the background (step 414). The remaining keys inthe set of randomly generated candidate RSS keys may be, for example,candidate RSS keys 232 in FIG. 2. The data processing system alsogenerates a respective packet distribution score corresponding to eachremaining key in the set of randomly generated candidate RSS keys basedon the predicted performance of each remaining key in the set ofrandomly generated candidate RSS keys in uniformly distributing the setof network packets across the plurality of processors located in thedata processing system (step 416). It should be noted that the dataprocessing system performs steps 410 and 412 in parallel with steps 414and 416.

Subsequently, the data processing system stores the packet distributionscore corresponding to the active RSS key and respective packetdistribution scores corresponding to each remaining key in the set ofrandomly generated candidate RSS keys in a storage device (step 418).The packet distribution scores may be, for example, packet distributionscores 234 in FIG. 2. The storage device may be, for example, persistentstorage 208 or memory 206 in FIG. 2. Thereafter, the process terminates.

With reference now to FIG. 5, a flowchart illustrating a process forselecting RSS keys is shown in accordance with an illustrativeembodiment. The process shown in FIG. 5 may be implemented in a dataprocessing system, such as, for example, server 104 or client 110 inFIG. 1 or data processing system 200 in FIG. 2.

The process begins when the data processing system makes a determinationas to whether a defined time interval expired (step 502). The definedtime interval may be, for example, defined time interval 236 in FIG. 2.If the data processing system determines that the defined time intervalhas not expired, no output of step 502, then the process returns to step502 where the data processing system continues to wait for the definedtime interval to expire. If the data processing system determines thatthe defined time interval has expired, yes output of step 502, then thedata processing system retrieves a stored packet distribution scorecorresponding to an active RSS key (step 504). The stored packetdistribution score corresponding to the active RSS key may be, forexample, a packet distribution score in packet distribution scores 234that corresponds to active RSS key 230 in FIG. 2.

In addition, the data processing system retrieves stored packetdistribution scores corresponding to each respective key in a set ofcandidate RSS keys (step 506). The stored packet distribution scorescorresponding to each respective key in the set of candidate RSS keysmay be, for example, remaining packet distribution scores in packetdistribution scores 234 that correspond to each of candidate RSS keys232 in FIG. 2. Afterward, the data processing system makes adetermination as to whether one or more keys in the set of candidate RSSkeys have a higher packet distribution score than the active RSS key(step 508). If the data processing system determines that no keys in theset of candidate RSS keys have a higher packet distribution score thanthe active RSS key, no output of step 508, then the data processingsystem continues to use the active RSS key to distribute incomingnetwork packets across a plurality of processors located in the dataprocessing system (step 510). The incoming network packets distributedacross the plurality of processors may be, for example, set of networkpackets 312 distributed across processor 314 and processor 316 in dataprocessing device 302 in FIG. 3.

If the data processing system determines that one or more keys in theset of candidate RSS keys have a higher packet distribution score thanthe active RSS key, yes output of step 508, then the data processingsystem selects an RSS key having a highest packet distribution scorefrom the one or more keys in the set of candidate RSS keys that have ahigher packet distribution score than the active RSS key (step 512).Further, the data processing system uses the RSS key having the highestpacket distribution score to distribute the incoming network packetsacross the plurality of processors located in the data processing system(step 514). Furthermore, the data processing system makes adetermination as to whether any keys in the set of candidate RSS keyshave a packet distribution score less than a defined packet distributionthreshold score (step 516). The defined packet distribution thresholdscore may be, for example, defined packet distribution threshold score238 in FIG. 2.

If the data processing system determines that no keys in the set ofcandidate RSS keys have a packet distribution score less than thedefined packet distribution threshold score, no output of step 516, thenthe process returns to step 502 where the data processing system waitsfor the next defined time interval to expire. If the data processingsystem determines that one or more keys in the set of candidate RSS keyshave a packet distribution score less than the defined packetdistribution threshold score, yes output of step 516, then the dataprocessing system discards those RSS keys, such as RSS keys 240 in FIG.2, having a packet distribution score less than the defined packetdistribution threshold score (step 518). The data processing system alsogenerates a number of new RSS keys to replace those discarded RSS keyshaving a packet distribution score less than the defined packetdistribution threshold score (step 520). The number of new RSS keysreplacing the discarded RSS keys may be, for example, new replacementkeys 242 in FIG. 2. Thereafter, the process returns to step 502 wherethe data processing system waits for the next defined time interval toexpire.

Thus, illustrative embodiments of the present invention provide acomputer-implemented method, computer system, and computer programproduct for selecting an RSS key having a highest packet distributionscore to balance distribution of incoming network packets acrossmultiple processors in a multiprocessor device or across multipleprocessor cores in one multicore processor. The descriptions of thevarious embodiments of the present invention have been presented forpurposes of illustration, but are not intended to be exhaustive orlimited to the embodiments disclosed. Many modifications and variationswill be apparent to those of ordinary skill in the art without departingfrom the scope and spirit of the described embodiments. The terminologyused herein was chosen to best explain the principles of theembodiments, the practical application or technical improvement overtechnologies found in the marketplace, or to enable others of ordinaryskill in the art to understand the embodiments disclosed herein.

What is claimed is:
 1. A computer-implemented method for selecting areceive side scaling (RSS) key, the computer-implemented methodcomprising: determining, by a data processing system, whether a definedtime interval expired; responsive to the data processing systemdetermining that the defined time interval has expired, determining, bythe data processing system, whether one or more keys in a set ofrandomly generated candidate RSS keys have a higher packet distributionscore than an active RSS key; responsive to the data processing systemdetermining that the one or more keys in the set of randomly generatedcandidate RSS keys have the higher packet distribution score than theactive RSS key, selecting, by the data processing system, an RSS keyhaving a highest packet distribution score from the one or more keys inthe set of randomly generated candidate RSS keys that have the higherpacket distribution score than the active RSS key; and using, by thedata processing system, the RSS key having the highest packetdistribution score to distribute incoming network packets across aplurality of processors corresponding to the data processing system. 2.The computer-implemented method claim 1 further comprising: responsiveto the data processing system determining that no keys in the set ofrandomly generated candidate RSS keys have the higher packetdistribution score than the active RSS key, continuing to use, by thedata processing system, the active RSS key to distribute the incomingnetwork packets across the plurality of processors corresponding to thedata processing system.
 3. The computer-implemented method claim 1further comprising: determining, by the data processing system, whetherthe one or more keys in the set of randomly generated candidate RSS keyshave a corresponding packet distribution score less than a packetdistribution threshold score; and responsive to the data processingsystem determining that the one or more keys in the set of randomlygenerated candidate RSS keys have the corresponding packet distributionscore less than the packet distribution threshold score, discarding, bythe data processing system, those RSS keys having the correspondingpacket distribution score less than the packet distribution thresholdscore.
 4. The computer-implemented method claim 3 further comprising:randomly generating, by the data processing system, a number of new RSSkeys to replace those discarded RSS keys having the corresponding packetdistribution score less than the packet distribution threshold score. 5.The computer-implemented method claim 1 further comprising: generating,by the data processing system, a candidate key pool containing the setof randomly generated candidate RSS keys; and selecting, by the dataprocessing system, a key from the set of randomly generated candidateRSS keys to be the active RSS key for distributing the incoming networkpackets across the plurality of processors corresponding to the dataprocessing system.
 6. The computer-implemented method claim 1 furthercomprising: receiving, by the data processing system, the incomingnetwork packets via a network; distributing, by the data processingsystem, the incoming network packets across the plurality of processorscorresponding to the data processing system using the active RSS key;evaluating, the data processing system, performance of the active RSSkey in uniformly distributing the incoming network packets across theplurality of processors corresponding the data processing system; andgenerating, by the data processing system, a packet distribution scorecorresponding to the active RSS key based on the evaluating of theperformance of the active RSS key in uniformly distributing the incomingnetwork packets across the plurality of processors corresponding to thedata processing system.
 7. The computer-implemented method claim 6,wherein the active RSS key uniformly distributes the incoming networkpackets across the plurality of processors by sending an equal number ofnetwork packets to each processor in the plurality of processors.
 8. Thecomputer-implemented method claim 1 further comprising: predicting, bythe data processing system, performance of each key in the set ofrandomly generated candidate RSS keys in uniformly distributing theincoming network packets across the plurality of processorscorresponding to the data processing system in a background; andgenerating, by the data processing system, a respective packetdistribution score corresponding to each key in the set of randomlygenerated candidate RSS keys based on the predicting of the performanceof each key in the set of randomly generated candidate RSS keys inuniformly distributing the incoming network packets across the pluralityof processors corresponding to the data processing system.